package com.collect.zambia.zhiBean.zhiReceive;

import android.text.TextUtils;

import com.collect.zambia.zhiUtils.StringUtil;
import com.collect.zambia.zhiUtils.ZHICalendarUtil;

import java.io.Serializable;

public class ZHIRCustomerPerformanceEntity implements Serializable {
    private String assignDate;
    private String repayDate;
    private String assignNum;
    private String repayNum;
    private String repayRate;
    private String addRepayNum;

    //历史相关
    private String month;
    private String bonus;

    //首页对比相关
    private String limitDate;

    //组长相关
    private String Date;
    private String sysLoginName;
    private boolean highlightColor;

    //客服绩效v2版本
    private String taskNum;
    private String penalty;
    private String actualBonus;

    //小红花
    private String rankDisplay;

    public String getAssignDate() {
        return StringUtil.safeString(assignDate);
    }

    public String getAssignDateFormatDisplay() {
        return ZHICalendarUtil.getDateStringWithFormat(getAssignDate(), "yyyy-MM-dd", "MM-dd");
    }

    public void setAssignDate(String assignDate) {
        this.assignDate = assignDate;
    }

    public String getRepayDate() {
        return StringUtil.safeString(repayDate);
    }

    public void setRepayDate(String repayDate) {
        this.repayDate = repayDate;
    }

    public String getRepayDateFormatDisplay() {
        return ZHICalendarUtil.getDateStringWithFormat(getRepayDate(), "yyyy-MM-dd", "MM-dd");
    }

    public String getAssignNum() {
        return StringUtil.safeString(assignNum);
    }

    public void setAssignNum(String assignNum) {
        this.assignNum = assignNum;
    }

    public int getAssignNumFormatInt() {
        return StringUtil.numberTothousandFormatterInt(getAssignNum());
    }

    public String getRepayNum() {
        return StringUtil.safeString(repayNum);
    }

    public void setRepayNum(String repayNum) {
        this.repayNum = repayNum;
    }

    public int getRepayNumFormatInt() {
        return StringUtil.numberTothousandFormatterInt(getRepayNum());
    }

    public String getRepayRate() {
        return StringUtil.safeString(repayRate);
    }

    public void setRepayRate(String repayRate) {
        this.repayRate = repayRate;
    }

    public float getRepayRateFormatFloat() {
        float totalNumL = getAssignNumFormatInt() * 1.0F;
        float settledNumL = getRepayNumFormatInt() * 1.0F;

        return settledNumL / totalNumL;
    }

    public String getRepayRateFormat() {
        float totalNumL = getAssignNumFormatInt() * 1.0F;
        float settledNumL = getRepayNumFormatInt() * 1.0F;
        float collectRateL = settledNumL / totalNumL;
        return StringUtil.numberFormatterThousandPercent(collectRateL + "");
    }

    public String getLimitDate() {
        return StringUtil.safeString(limitDate);
    }

    public void setLimitDate(String limitDate) {
        this.limitDate = limitDate;
    }

    public boolean isHighLightFlag() {
        if (TextUtils.isEmpty(getLimitDate())) {
            return false;
        }

        long limitTimeL = ZHICalendarUtil.getTimeFromDateString(getLimitDate() + " 00:00:00", null);
        long assignTimeL = ZHICalendarUtil.getTimeFromDateString(getAssignDate() + " 00:00:00", null);
        long twoDayTimeL = 172800000L;

        return (limitTimeL - assignTimeL >= twoDayTimeL);
    }

    public boolean isAfter0706Date() {
        long limitTimeL = ZHICalendarUtil.getDateTimeOf0706L();
        long assignTimeL = ZHICalendarUtil.getTimeFromDateString(getAssignDate() + " 00:00:00", null);
        return assignTimeL > limitTimeL;
    }

    public boolean isAfter0801Date() {
        long limitTimeL = ZHICalendarUtil.getDateTimeOf0801L();
        long assignTimeL = ZHICalendarUtil.getTimeFromDateString(getMonth() + "-01 00:00:00", null);
        return assignTimeL >= limitTimeL;
    }


    public String getMonth() {
        return StringUtil.safeString(month);
    }

    public void setMonth(String month) {
        this.month = month;
    }

    public String getBonus() {
        return StringUtil.safeString(bonus);
    }

    public void setBonus(String bonus) {
        this.bonus = bonus;
    }

    public float getBonusFormatFloat() {
        float valueF = StringUtil.numberTothousandFormatterFloat(getBonus());
        return valueF;
    }

    public String getBonusFormat() {
        return StringUtil.numberTothousandFormatter(getBonus());
    }

    public String getAddRepayNum() {
        int inNum = StringUtil.numberTothousandFormatterInt(StringUtil.safeString(addRepayNum));
        if (inNum <= 0) {
            return "";
        }
        return String.valueOf(inNum);
    }

    public void setAddRepayNum(String addRepayNum) {
        this.addRepayNum = addRepayNum;
    }

    public String getDate() {
        return StringUtil.safeString(Date);
    }

    public void setDate(String date) {
        Date = date;
    }

    public String getSysLoginName() {
        return StringUtil.safeString(sysLoginName);
    }

    public void setSysLoginName(String sysLoginName) {
        this.sysLoginName = sysLoginName;
    }

    public boolean isHighlightColor() {
        return highlightColor;
    }

    public void setHighlightColor(boolean highlightColor) {
        this.highlightColor = highlightColor;
    }

    public String getTaskNum() {
        return StringUtil.safeString(taskNum);
    }

    public void setTaskNum(String taskNum) {
        this.taskNum = taskNum;
    }

    public int getTaskNumFormatInt() {
        return StringUtil.numberTothousandFormatterInt(getTaskNum());
    }

    public String getPenalty() {
        return StringUtil.safeString(penalty);
    }

    public String getPenaltyFormat() {
        return StringUtil.numberTothousandFormatter(getPenalty());
    }

    public void setPenalty(String penalty) {
        this.penalty = penalty;
    }

    public String getActualBonus() {
        return StringUtil.safeString(actualBonus);
    }

    public String getActualBonusFormat() {
        return StringUtil.numberTothousandFormatter(getActualBonus());
    }

    public void setActualBonus(String actualBonus) {
        this.actualBonus = actualBonus;
    }

    public String getRankDisplay() {
        return StringUtil.safeString(rankDisplay);
    }

    public boolean isYellowCard(){
        return getRankDisplay().equalsIgnoreCase(ZHIRCollecterPerformanceEntity.TYPE_YELLOW_CARD);
    }

    public boolean isGreenCard(){
        return getRankDisplay().equalsIgnoreCase(ZHIRCollecterPerformanceEntity.TYPE_FLOWER);
    }

    public void setRankDisplay(String rankDisplay) {
        this.rankDisplay = rankDisplay;
    }


}
